<template>
  <div>
    <div class='banner' @click="handleClickGallary">
        <img  class="banner-img" width="100%" :src="bannerImg" alt="">
        <div class="banner-info">
          <div class="banner-title">{{sightName}}</div>
          <div class="banner-number">
             <span class="iconfont icon-right">&#xe635;</span>
             {{this.gallaryImgs.length}}
          </div>
        </div>
    </div>
    <common-gallary :imgs='gallaryImgs' v-show="showGallary" @handleGallaryClose='handleGallaryClose'></common-gallary>
    <common-fade-animation></common-fade-animation>
  </div>
</template>

<script>
  import CommonGallary from 'common/gallary/gallary.vue'
  import CommonFadeAnimation from 'common/fade/FadeAnimation.vue'
  export default{
    name: 'DetailBanner',
    props: {
      gallaryImgs:Array,
      bannerImg:String,
      sightName:String
    },
    components: {
      CommonGallary,
      CommonFadeAnimation
    },
    data() {
      return {
         showGallary:false,
      }
    },
    methods: {
      handleClickGallary() {
        this.showGallary = true
      },
      handleGallaryClose() {
         this.showGallary = false
      }
    }
  }
</script>

<style lang="stylus" scoped>
.banner
  position relative
  overflow hidden
  height 0
  padding-bottom 53%
.banner-img
  width 100%
.banner-info
  display flex
  position absolute
  left 0
  right 0
  bottom 0
  line-height .6rem
  color #FFFFFF
  background-image linear-gradient(top,rgba(0,0,0,0.5))
.banner-title
   flex 1
   text-align left
   margin-left .1rem
   font-size .32rem
.banner-number
   padding 0 .4rem
   margin-bottom .01rem
</style>
